# Contributor: Milan P. Stanić <mps@arvanta.net>
# Maintainer: Milan P. Stanić <mps@arvanta.net>
pkgname=vifm
pkgver=0.13
pkgrel=1
pkgdesc="ncurses vi-like file manager"
url="https://vifm.info/"
arch="all"
license="GPL-2.0-or-later"
makedepends="ncurses-dev coreutils mandoc perl file-dev"
subpackages="
	$pkgname-doc
	$pkgname-bash-completion
	$pkgname-fish-completion
	$pkgname-zsh-completion
	"
source="$pkgname-$pkgver.tar.gz::https://github.com/vifm/vifm/archive/v$pkgver.tar.gz
	perl-interpreter-fix.patch
	disable-failed-tests.patch
	"

prepare() {
	default_prepare

	update_config_sub
	update_config_guess
}

build() {
	./configure \
		--build=$CBUILD \
		--host=$CHOST \
		--prefix=/usr \
		--sysconfdir=/etc \
		--mandir=/usr/share/man \
		--localstatedir=/var \
		--with-libmagic \
		--without-X11 \
		--without-gtk \
		--disable-build-timestamp
	make
}

check() {
	make check
}

package() {
	make DESTDIR="$pkgdir" install
}

sha512sums="
bd5e9f84cfb176e220e798dcdfc62e2ae3e89dbebd08cf4cce73eb843b85060c2df05f04f4db994d406baf2e0f90a04f5cb871beaf00fb04174464c81dd85938  vifm-0.13.tar.gz
9aa55e00be8b8305184f16d76cb61cfc16ee90772c69c52d1b740f1fddbc2f7ea63a3586a0269c6bd6f5c5209c0956bec3a0c0094dc2a693390cde4c63ffa8d6  perl-interpreter-fix.patch
665e07ed19dab59f6ef4201d35c9579f2cfbede82822f7d32c88b059bf117828b774d1b4139ff86545d76fb20e1f8a07fa273b2f73abb6fb03a53ca1463d17b7  disable-failed-tests.patch
"
